<?php $this->placeholder('onReady')->captureStart() ?>
	$("#<?php echo $this->id_tablesorter?>").tablesorter(); 
<?php $this->placeholder('onReady')->captureEnd() ?>




<div class="contenedor_tablesorter">
<?if($this->rows):?>
<table id="<?= $this->id_tablesorter?>" width="100%" class="tablesorter"> 
    <caption>
       <div id="total_table_filter" style="float: right;">Total <span class="filtradas"><?=count($this->rows)?> Registros</span></div>    
    </caption>
<thead>
<tr>
    <th><?php echo $this->translate('Fecha');?></th>
    <th><?php echo $this->translate('PEP');?></th>
    <th><?php echo $this->translate('Proyecto');?></th>
    <th><?php echo $this->translate('kWh Consumidos');?></th>
    <th><?php echo $this->translate('K');?></th>
    <th><?php echo $this->translate('KWh facturables');?></th>
    <th><?php echo $this->translate('Precio €/kWh');?></th>
    <th><?php echo $this->translate('Importe €');?></th>
    <th><?php echo $this->translate('% Gestión');?></th>
    <th><?php echo $this->translate('Importe Gestión');?></th>
    <th><?php echo $this->translate('Facturación €');?></th>
    <th><?php echo $this->translate('Modalidad Facturación');?></th>
    <th><?php echo $this->translate('Detalle');?></th>
    
</tr>
</thead>
<tbody>
<?foreach($this->rows as $k => $v):?>


<tr>
    <td><span class="ui-icon ui-icon-<?=$v['publicado'] ? 'circle-check' :'alert'?>" style="float:left;"></span><?=$v['fecha']?></td>
    <td><?=$v['orden']?></td>
    <td><?=$this->anchor("proyecto/ficha/idZona/{$this->idZona}/id_proyecto/".$v['id_proyecto'],$v['proyecto'],null,false)?></td>
    <td><?=$this->NumEs($v['consumo_equipos_propios'],0)?><?=$this->linkchart("index/proyecto/id_proyecto/{$v['id_proyecto']}/grafico/consumo")?></td>
    <td><?=$this->NumEs($v['coeficiente_facturacion'],2)?></td>
    <td><?=$this->NumEs($v['consumo_facturable'])?></td>
    <td><?=$this->NumEs($v['precio_aplicado'],4)?></td>
    <td><?=$this->NumEs($v['importe'],2);?></td>
    <td><?=$this->NumEs($v['porcentaje_gestion'],2);?></td>
    <td><?=$this->NumEs($v['import_gestion'],2);?></td>
    <td><?=$this->NumEs($v['fact_consumo'],2);?></td>
    <td><?=$this->escape($v['texto_facturacion'])?></td>
    
    
    <td><?=$this->anchor("electricidad/detalle{$this->actionReal}/idZona/{$this->idZona}/mes/{$v['mes']}/anio/{$v['anio']}/id_proyecto/{$v['id_proyecto']}",'<img src="/img/viewmag.png" border="0">',null,false)?>
    
    </td>
  </tr>
<?endforeach?>
</tbody>
<tfoot>
<tr>
    <th></th>
    <th></th>
    <th></th>
    <th><?php echo $this->numES($this->suma['consumo_equipos_propios'],0);?> kWh</th>
    <th></th>
    <th><?php echo $this->numES($this->suma['consumo_facturable'],0);?> kWh</th>
    <th></th>
    <th><?php echo $this->numES($this->suma['importe'],0);?> €</th>
    <th></th>
    <th><?php echo $this->numES($this->suma['import_gestion'],0);?> €</th>
    <th><?php echo $this->numES($this->suma['fact_consumo'],0);?> €</th>
    <th></th>
    <th></th>
</tr>
</tfoot>
</table>
<?if(Sgit_Validate_isDatacenter::isValid()):?>
<div class="atencion ui-state-highlight" > 
    <span class="ui-icon ui-icon-circle-check" style="float:left;"></span><?php echo $this->translate('Publicado');?><br /><br />
    <span class="ui-icon ui-icon-alert" style="float:left;"></span><?php echo $this->translate('No Publicado, no es visible para administración, JP,etc');?><br />
</div>

<?endif?>
<?endif?>
</div>


